package com.chat.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chat.admin.mapper.RoleAuthorityMappingMapper;
import com.chat.admin.service.IRoleAuthorityMappingService;
import com.chat.common.entity.RoleAuthorityMapping;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author weikjie
 * @since 2024-04-14
 */
@Service
public class RoleAuthorityMappingServiceImpl extends ServiceImpl<RoleAuthorityMappingMapper, RoleAuthorityMapping> implements IRoleAuthorityMappingService {

    @Override
    public Integer BatchInsertion(Collection<RoleAuthorityMapping> entityList) {
        return baseMapper.insertBatchSomeColumn(entityList);
    }

    @Override
    public int deleteRoleAuthority(Long roleId) {
        QueryWrapper<RoleAuthorityMapping> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("role_id", roleId);
        return baseMapper.delete(queryWrapper);
    }
}
